package deepbrain.simnetwork.monitor;

import deepbrain.simnetwork.task.Task;

/**
 * 
 * 
 * @author Li Yang
 * @create 2009-2-23
 */
public interface Monitor<TaskType extends Task> {

	/**
	 * Trigger once before task start.
	 */
	public void onTaskStart(TaskType task);

	/**
	 * Trigger once after each time step of task. Defined by specified
	 * task,e.g., SimulationTask trigger this after each time step.
	 */
	public void onStepFinish(TaskType task);

	/**
	 * Trigger once after task finished.
	 */
	public void onTaskFinish(TaskType task);

	/**
	 * @return true if this monitor only use once, in other words, it will be
	 *         removed from task after task finished.
	 */
	public boolean useOnce();

}
